package com.ruoyi.open.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.open.domain.Client;
import com.ruoyi.open.mapper.ClientMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.open.mapper.ClientMapper;
import com.ruoyi.open.domain.Client;
import com.ruoyi.open.service.ClientService;

/**
 * 开放平台Service业务层处理
 *
 * @author anan
 * @date 2021-04-02
 */
@Service
public class ClientServiceImpl extends ServiceImpl<ClientMapper, Client> implements ClientService
{
    @Autowired
    private ClientMapper clientMapper;

    /**
     * 查询开放平台
     *
     * @param id 开放平台ID
     * @return 开放平台
     */
    @Override
    public Client selectClientById(Long id)
    {
        return clientMapper.selectClientById(id);
    }

    /**
     * 查询开放平台列表
     *
     * @param client 开放平台
     * @return 开放平台
     */
    @Override
    public List<Client> selectClientList(Client client)
    {
        return clientMapper.selectClientList(client);
    }

    /**
     * 新增开放平台
     *
     * @param client 开放平台
     * @return 结果
     */
    @Override
    public int insertClient(Client client)
    {
        client.setCreateTime(DateUtils.getNowDate());
        return clientMapper.insertClient(client);
    }

    /**
     * 修改开放平台
     *
     * @param client 开放平台
     * @return 结果
     */
    @Override
    public int updateClient(Client client)
    {
        client.setUpdateTime(DateUtils.getNowDate());
        return clientMapper.updateClient(client);
    }

    /**
     * 批量删除开放平台
     *
     * @param ids 需要删除的开放平台ID
     * @return 结果
     */
    @Override
    public int deleteClientByIds(Long[] ids)
    {
        return clientMapper.deleteClientByIds(ids);
    }

    /**
     * 删除开放平台信息
     *
     * @param id 开放平台ID
     * @return 结果
     */
    @Override
    public int deleteClientById(Long id)
    {
        return clientMapper.deleteClientById(id);
    }
}
